package com.smart.model.convert;

import com.smart.model.dtomapper.OperateRolePermissionDtoMapper;
import com.smart.model.domain.OperateRolePermissionDO;
import com.smart.model.vo.OperateRolePermissionVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class OperateRolePermissionConvert {

    public static List<OperateRolePermissionVO> buildOperateRolePermissionVoList(List<OperateRolePermissionDO> operateRolePermissionDOList) {
        if (CollectionUtils.isEmpty(operateRolePermissionDOList)) {
            return Lists.newArrayList();
        }
        List<OperateRolePermissionVO> operateRolePermissionVOList = new ArrayList<>();
        for (OperateRolePermissionDO operateRolePermissionDO : operateRolePermissionDOList) {
            operateRolePermissionVOList.add(OperateRolePermissionDtoMapper.INSTANCE.do2VO(operateRolePermissionDO));
        }

        return operateRolePermissionVOList;
    }
}
